﻿using System;

class Task2
{
    static void Main()
    {
        // 70 / 100
        int nRound = int.Parse(Console.ReadLine());
        int countV = 0;
        int countM = 0;

        for (int i = 0; i < nRound; i++)
        {
            int number = int.Parse(Console.ReadLine());
            int digit = 1;
            int numberOfDigits = 0;
            for (int j = 0; j < 9; j++)
            {
                if (number / digit > 0)
                {
                    numberOfDigits += 1;
                }
                digit *= 10;
            }
            //Console.WriteLine(numberOfDigits);

            if (numberOfDigits % 2 == 0)    //четен брой числа в номера
            {
                for (int k = 0; k < numberOfDigits / 2; k++)
                {
                    countV = countV + number % 10;
                    number = number / 10;
                }
                for (int l = 0; l < numberOfDigits / 2; l++)
                {
                    countM = countM + number % 10;
                    number = number / 10;
                }
            }

            if (numberOfDigits % 2 != 0)    //нечетен брой числа в номера
            {
                int lastdigit = 0;
                for (int k = 0; k < (numberOfDigits / 2) + 1; k++)
                {
                    lastdigit = number % 10;
                    countV = countV + number % 10;
                    number = number / 10;
                }
                number = number * 10 + lastdigit;
                for (int l = 0; l < (numberOfDigits / 2) + 1; l++)
                {
                    countM = countM + number % 10;
                    number = number / 10;
                }
            }
        }
        //Console.WriteLine(countV);
        //Console.WriteLine(countM);

        if (countM > countV)
        {
            Console.WriteLine("M {0}", countM - countV);
        }
        else if (countV > countM)
        {
            Console.WriteLine("V {0}", countV - countM);
        }
        else if (countM == countV)
        {
            Console.WriteLine("No {0}", countM + countV);
        }

    }
}

